ArchLinux Package Build Script

Table of Contents

A PKGBUILD is a Bash script containing the build information required by Arch Linux packages. 1

1. Essential Variables 2

In order to name a package, these variables are important.

pkgbase
pkgname
pkgver (required)
The version of the package, consisting of letters, numbers, periods, and underscores.
pkgrel (required)
The release number.
pkgdesc
The description of the package, usually <= 80 words.
arch (required)
An array of architecturs that this PKGBUILD is intended to build and work on. Like x86_64. For most of the cases, we can use arch=(any) to indicate the package can be built on any architecture.
license
The open-source license.

1.1. Managing Dependencies

depends

An array of packages that must be installed for the software to build and run. Packages can be constrained with >, >=, <, <= to specify certain versions.

Dependencies should normally include the requirements for building all optional features of a package.

makedepends
An array of packages that are only required to build the package.
checkdepends
An array of packages required to run its tests, but at runtime.
optdepends
An array of packages that are not needed for the software to function, but provide additional features.

1.2. Package Relations

provides

2. Makepkg Utility 3

Footnotes:

1

Templates for PKGBUILD are available as .proto files under /usr/share/pacman/.

Date: 2026-08-01 Sat

Author: ArcaLunar